home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 4,101 to 4,200 / aol-file-protocol-4400-4101-to-4200.zip / AOLDLs / ADV - Message Board Archives / Archived Msgs_ BASIC Formulas / AO.CMPLXF.log next >
Text File  |  2014-11-30  |  3KB  |  80 lines

  1. America Online Archived Messages!
  2. Distribute freely, but don't modify.
  3. Archived Path: BASIC/Formula too Complex?!?
  4. Copyright America Online.
  5. ===============================================================================
  6. Subj:  The problem...                        90-09-25 01:11:45 EST
  7. From:  AFA JoeyS
  8. Posted on: America Online
  9.  
  10. Okay, I finally finished my amper package (see related topic, "2 byte reads/writes", below :), and thought that everything was peachy keen, as all the routines worked fine in individual tests.  However, put them together in a program, and you start getting problems.  For example...
  11.  
  12. 1 GOTO 2000
  13. 50 IF LEFT$(FI$,2)="2/" THEN FI$=P2$+MID$(FI$,3)
  14. 51 RETURN
  15. 60 GOSUB 50: & TYPE (FI$) :REM dump the specified text file
  16. 61 RETURN
  17. 2000 & INPUT "path> ",FI$:& CHK(FI$):IF NOT PEEK(222) THEN GOSUB 60
  18.  
  19. Okay, you can get an idea of what that's supposed to do.  Unfortunately, try running it, and you get
  20.  
  21. ?FORMULA TOO COMPLEX ERROR IN 50
  22.  
  23. My question: What can cause this error??  The manuals only say "more than two IF xx statements in an expression" or something to that effect.  Obviously, my code isn't that complicated; however, I DO use FrmEvl ($DD7B) in several of the ampers called before the error occurs.  Could that be messing up some sort of pointers??
  24.  
  25. Thanks, :)...
  26.  
  27. --Joey
  28.  
  29.  
  30.  
  31.  
  32. Path: BASIC/Formula too Complex?!?
  33.  
  34. Subj:  Too many string temps?                90-09-25 19:43:30 EST
  35. From:  Eight bits
  36. Posted on: America Online
  37.  
  38. Hi, Joe
  39.  
  40. I've got more ideas, but again, if anyone knows these things, please jump in.
  41.  
  42. It looks like you can also get the FORMULA TOO COMPLEX error if you have too many temporary strings. Try the following:
  43.  
  44.  10 A$ = "A"
  45.  20  PRINT  A$ + ("B" + ("C" + "D"))
  46.  30  PRINT "A" + ("B" + ("C" + "D"))
  47.  
  48. Line 30 seems to have one temp too many.
  49.  
  50. I think that when you call FrmEvl and it finds a variable name such as FI$ then it just gives you the descriptor in the variable table, but if FrmEvl instead finds a string expression or constant such as "path> " then it builds a temporary descriptor. But if you don't then free up this temporary descriptor then I suspect it will limit the number of future temporaries that can be created, causing the error. It looks to me from the Crossley article that you could call FreStr at $E5FD after each call to FrmEvl. The idea would be to free up any temporaries, while still providing you with the string address (in Index, and in Y,X) and with the string length (in A).
  51.  
  52. I've never used FreStr though, and of course I haven't tried it here since I don't have the amper routines. Does it work? 
  53.  
  54. Jerry
  55.  
  56.  
  57. Path: BASIC/Formula too Complex?!?
  58.  
  59. Subj:  FreStr...                             90-09-25 22:14:25 EST
  60. From:  AFA JoeyS
  61. Posted on: America Online
  62.  
  63. Oh.  I didn't even see that one.  %)  I have no idea, Jerry, but I'll take a look -- and you've been quite on the target in the past, so I'm optimistic.  :)
  64.  
  65. I'll report back later.
  66.  
  67.  
  68. Path: BASIC/Formula too Complex?!?
  69.  
  70. Subj:  It worked, :)...                      90-09-26 00:52:25 EST
  71. From:  AFA JoeyS
  72. Posted on: America Online
  73.  
  74. What a nice change of pace; a quick solution to a problem, LOL.
  75.  
  76. Thanks muchly, Jerry, you were quite right: adding a JSR FreStr after the JSR FrmEvl seems to keep BASIC happy.  Really nice job there coming up with the answer so quickly... ()()()()  :)
  77.  
  78.  
  79. (now I'm taking bets for how long it'll be before my NEXT silly Applesoft <--> M/L problem comes along...)
  80.